package com.tangyuan.user.feign;

import com.tangyuan.common.result.Result;
import com.tangyuan.feignapis.user.IUserConcernFeignClient;
import com.tangyuan.model.UserConcern;
import com.tangyuan.user.service.UserConcernService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class UserConcernClient implements IUserConcernFeignClient {

    @Autowired
    private UserConcernService userConcernService;

    @GetMapping("/feignApi/user/selectUserConcernList")
    @Override
    public List<UserConcern> selectUserConcernList(@RequestParam(value = "userId",required = false) Long userId,
                                                   @RequestParam(value = "concernUserId",required = false) Long concernUserId) {
        return userConcernService.selectUserConcernList(userId,concernUserId);
    }

    @Override
    public Long getLiveConcernNum(Long concernUserId, Integer type,Long concernId){
        return userConcernService.getLiveConcernNum(concernUserId,type,concernId);
    }

    @Override
    public Result<Boolean> isConcern(Long userId, Long concernUserId){
        return userConcernService.isConcern(userId,concernUserId);
    }
}
